package com.lz.common.annotation;

import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Component;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

@Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE})
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
public @interface PreventDuplicateSubmit {


    /**
     * 默认重复时间为2秒
     *
     * @return
     */
    int timeout() default 5;

    /**
     * 自定义锁key的前缀
     */
    String keyPrefix() default "duplicate_submit:";

    /**
     * 提示消息
     */
    String message() default "请勿重复提交";

}
